import React from 'react';
import { Col, Form, Row } from 'antd';
import LinkTo from '@/components/LinkTo';
import FormContainer from './FormContainer';
import InterviewRecords from './InterviewRecords';

/**
 * 员工档案 - 应聘记录
 */
const RecruitmentSection = ({ formData }) => (
    <>
        <FormContainer title="应聘记录" hasEditAuth={false}>
            {() => (
                <>
                    <Row gutter={24}>
                        <Col span={12}>
                            <Form.Item label="应聘岗位">
                                <span>{formData?.dutyName}</span>
                            </Form.Item>
                        </Col>
                        <Col span={12}>
                            <Form.Item label="应聘时间">
                                <span>{formData?.acceptDate}</span>
                            </Form.Item>
                        </Col>
                    </Row>
                    <Row gutter={24}>
                        <Col span={12}>
                            <Form.Item label="招聘负责人">
                                <span>{formData?.principalEmployeeName}</span>
                            </Form.Item>
                        </Col>
                        <Col span={12}>
                            <Form.Item label="录用时间">
                                <span>{formData?.employDate}</span>
                            </Form.Item>
                        </Col>
                    </Row>
                    <Row gutter={24}>
                        <Col span={12}>
                            <Form.Item label="应聘简历">
                                {formData?.candidateId && (
                                    <LinkTo
                                        to="/office/personnelManagement/recruitment/resume/detail"
                                        query={{
                                            id: formData.resumeId,
                                            candidateId: formData.candidateId,
                                            employId: formData.employId,
                                            activeKey: 'RESUME'
                                        }}
                                    >
                                        查看简历详情
                                    </LinkTo>
                                )}
                            </Form.Item>
                        </Col>
                        <Col span={12}>
                            <Form.Item label="录用信息">
                                <LinkTo
                                    to="/office/personnelManagement/recruitment/resume/detail"
                                    query={{
                                        id: formData.resumeId,
                                        candidateId: formData.candidateId,
                                        employId: formData.employId,
                                        activeKey: 'HIRE'
                                    }}
                                >
                                    查看录用详情
                                </LinkTo>
                            </Form.Item>
                        </Col>
                    </Row>
                </>
            )}
        </FormContainer>
        <FormContainer title="面试记录" hasEditAuth={false}>
            {() => <InterviewRecords formData={formData} />}
        </FormContainer>
    </>
);

export default RecruitmentSection;
